using DG.Tweening;
using UnityEngine;

namespace CGF
{
    public class PrizeCardDemo : MonoBehaviour
    {
        public PrizeCard prize1, prize2;
        public CButton btnStart;

        public void Awake()
        {
            btnStart.SetClick(() =>
            {
                prize1.StartRun(0, 10, (int index, bool isStoped) =>
                {
                    Transform cell = transform.GetChild(index);
                    cell.transform.DOKill();
                    cell.transform.localScale = Vector3.one * 0.6f;
                    cell.transform.DOScale(Vector3.one, 0.3f);
                    if (isStoped)
                    {
                        Debug.Log($"停下了");
                    }
                });

                prize2.StartRun(0, 10, (int index, bool isStoped) =>
                {
                    Transform cell = transform.GetChild(index);
                    cell.transform.DOKill();
                    cell.transform.localScale = Vector3.one * 0.6f;
                    cell.transform.DOScale(Vector3.one, 0.3f);
                    if (isStoped)
                    {
                        Debug.Log($"停下了");
                    }
                });
            });
        }
    }
}